package com.example.myapplication.module1.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.TextView
import com.example.myapplication.R
import com.example.myapplication.databinding.ItemChooseTypeBinding
import com.example.mylibrary.adapter.BaseRecyclerAdapter

class ChooseTypeAdapter(context: Context) : BaseRecyclerAdapter<ItemChooseTypeBinding>(context) {
    var typeList = mutableListOf<String>()
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun getBinding(
        inflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ItemChooseTypeBinding {
       return ItemChooseTypeBinding.inflate(inflater,parent,false)
    }

    override fun bindHolder(holder: BaseViewHolder, position: Int) {
        viewBinding.tvClientType.text = typeList[position]
    }

    override fun getItemCount(): Int {
        return typeList.size
    }
}
